Skip to content

convert everything to ESM#355

Merged
Rich-Harris merged 10 commits into
masterfrom
gh-349
Feb 10, 2021
Merged

convert everything to ESM#355
Rich-Harris merged 10 commits into
masterfrom
gh-349

Conversation

@Rich-Harris

Copy link
Copy Markdown
Member

#349.

Most stuff doesn't work yet. The app-utils tests are passing, but the kit unit tests won't at least until the new version of Meriyah is released.

The integration tests in test don't work, because I haven't been able to get uvu to work with tests that are loaded asynchronously (cc @lukeed). The simplest way to see this is to cd test/apps/amp (after updating dependencies) and pnpm test:

(node:24774) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'push' of undefined

@Rich-Harris Rich-Harris mentioned this pull request Feb 1, 2021
lukeed and others added 2 commits February 1, 2021 18:38
* fix(test): manually control `UVU_QUEUE` positions;

Have to replicate the `uvu` internals since all internal loader/iterator logic is bypassed.

* fix: force `UVU_QUEUE` values

* chore: add `context.reset` method;

- chasing unterminated process

* fix(kit): return `snowpack.shutdown` promise

- so that `dev.close` is await'able

* fix(runner): manually exit process;

- also part of what uvu cli does; derp

* chore: convert "test/apps/basics" fixture

* chore: convert "test/apps/options" fixture
@benmccann

benmccann commented Feb 8, 2021

Copy link
Copy Markdown
Member

the kit unit tests won't at least until the new version of Meriyah is released

meriyah 4.1.1 is out now (though I'm having some trouble using it. I haven't tried it with this PR though)

@benmccann

Copy link
Copy Markdown
Member

I found another issue related to this. In the hn.svelte.dev example, after running svelte-kit build && svelte-kit adapt, there's a file functions/render/app.cjs and functions/render/index.js. The latter tries to do const app = require('./app.js'); which doesn't work now that the extension is .cjs. Should we switch the hn.svelte.dev example to be "type": "module" and convert app.cjs to app.js?

@Rich-Harris

Copy link
Copy Markdown
Member Author

yeah, i followed #356 up with #362 — will need the same thing here

Comment thread packages/kit/src/api/dev/loader.js Outdated
@Rich-Harris

Copy link
Copy Markdown
Member Author

the import/no-unresolved lint failure is weird

@Rich-Harris Rich-Harris merged commit a00f0ee into master Feb 10, 2021
@Rich-Harris Rich-Harris deleted the gh-349 branch February 10, 2021 01:16
@benmccann benmccann mentioned this pull request Feb 10, 2021
benmccann pushed a commit that referenced this pull request Feb 10, 2021
* start converting everything to ESM

* more stuff

* chore: finish ESM conversion (#360)

* fix(test): manually control `UVU_QUEUE` positions;

Have to replicate the `uvu` internals since all internal loader/iterator logic is bypassed.

* fix: force `UVU_QUEUE` values

* chore: add `context.reset` method;

- chasing unterminated process

* fix(kit): return `snowpack.shutdown` promise

- so that `dev.close` is await'able

* fix(runner): manually exit process;

- also part of what uvu cli does; derp

* chore: convert "test/apps/basics" fixture

* chore: convert "test/apps/options" fixture

* bump meriyah

* all tests passing, i think?

* simplify

* get CLI working

* brute force

Co-authored-by: Luke Edwards <luke.edwards05@gmail.com>
@tanhauhau tanhauhau mentioned this pull request Feb 22, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants